import { useAppStore } from '@/store/modules/app'
const appStore = useAppStore()

const textColor = appStore.getIsDark ? '#fff' : 'rgb(48, 49, 51)'
export const pieOptions = () => {
  return {
    color: [
      "#30e254",
      "#e82b1d",
      "#dff045",
      "#c1c8c2"
    ],
    title: {
      text: "总数",
      subtext: '',
      textStyle: {
        color: textColor,
        fontSize: 14,
        align: 'center'
      },
      subtextStyle: {
        fontSize: 16,
        color: ["#ff9d19"]
      },
      textAlign: 'center',
      left: "28%",
      top: "45%",
    },
    grid: {
    },
    legend: {
      top: "10%",
      left: '60%',
      orient: 'vertical',
      itemWidth: 10,
      itemHeight: 10,
      textStyle: {
        color: textColor,
        fontSize: 12,
      },
      itemGap: 45,
      icon: "circle",
      data: [],
      show: true
    },
    series: [
      // 主要展示层的
      {
        radius: ["55%", "65%"],
        center: ["30%", "55%"],
        type: "pie",
        label: {
          normal: {
            show: false,
            formatter: "{b}: {d}\n{c}%",
            textStyle: {
              fontSize: 14,
            },
            position: "outside",
          },
          emphasis: {
            show: false,
          },
        },
        labelLine: {
          normal: {
            show: false,
            length: 10,
            length2: 15,
          },
          emphasis: {
            show: false,
          },
        },
        name: "",
        data: [],
      }
    ],
  };
}
